(defclass (person name address height))

(defclass (building name address value height number-of-rooms))



'(def p1 (person "Chris" "Thunstetten"))

'(def b1 (building "Hicks Building" "Wall Street" 1e6 100 19))



(defclass (point [real? x] [real? y]))
(defclass (line [point? start] [point? end])
  (defmethod (length _)
    (def (square x) (* x x))
    (sqrt (+ (square (- (.x start) (.x end)))
             (square (- (.y start) (.y end)))))))

(def p0 (point 0 0))
(def p1 (point 10 5))
(def p2 (point -20 3))

(def l1 (line p0 p1))

(defclass (square [point? lower-left]
                  [real? side-length])
  (defmethod (area _)
    (* side-length side-length)))

(def s1 (square p1 10))

(defclass (circle [point? center]
                  [real? radius])
  (defmethod (area _)
    (def (square x) (* x x))
    (* pi (square radius))))

(def c1 (circle p2 2))

(def myshapes (list s1 c1))

'(def (=> myshapes
          (.map )))


;; C-64 computer: 65536 bytes   addresses 0 .. 65535  RAM  random-access memory
;; addr= malloc(10000)   malloc(10) 

(def v (vector 100 300 90))
;; Pros:
;; - efficient for random access
;; Cons:
;; - extending the vector is expensive to do functionally
;;   (you can pre-allocate memory, and mutate, but that's not functional)


(def l (list 100 300 90))

 
;; (def (array-ref ptr i)
;;      (fetch-value-at-address (+ ptr i)))

;; (array-ref 28444 9999)

